home *** CD-ROM | disk | FTP | other *** search
/ macdrivermuseum.net / www.macdrivermuseum.net.tar / www.macdrivermuseum.net / nic / daynaccard121.sit / communicard installer 1.2.1 mac / CommuniCard Installer 1.2.1 / Dayna CommuniCard Plus < prev    next >
Text File  |  1995-11-10  |  7KB  |  354 lines

  1. !  Dayna CommuniCard Plus
  2. !
  3. !  'mlts' resource info for this modem:
  4. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  5. !    byte 2 == 00 -> reserved by Apple
  6. !    byte 3 == FF -> max hex chars in varstr 7 (255 dec)
  7. !    byte 4 == 00 -> max hex chars in varstr 8
  8. !    byte 5 == 00 -> max hex chars in varstr 9
  9. !
  10. @ORIGINATE
  11. @ANSWER
  12. !
  13. ! Set up the modem - label range is 1-10
  14. !
  15. ! Mac talks to the modem at 57,600 bps.  
  16. serreset 57600, 0, 8, 1
  17. !
  18. ! reset the serial port handshake options
  19. HSReset 0 1 0 0 0 0
  20. !
  21. settries 0
  22. @LABEL 1
  23. flush
  24. matchclr
  25. matchstr 1 3 "OK\13\10"
  26. ! &F    - recall factory settings
  27. ! &K3   - Enable CTS/RTS Hardware flow control (Set by AT&F)
  28. ! W2    - gives Connect with DCE result codes 
  29. ! X4    - Use extended result codes (Set by AT&F) 
  30. ! \J0   - Disable auto port rate adjust 
  31. ! &M0   - Use asynch mode (no reliability protocols) (Same as above)
  32. ! S7=90 - To allow for an international call
  33. ! S0=0  - Don't answer calls (Set by AT&F) 
  34. ! E0    - Turn command echo off
  35. ! \V1   - Enable protocol result code (14400/LAPM)
  36. write "AT&FE0W2\\J0\\N0&M0S7=90\13"
  37. matchread 30
  38. inctries
  39. iftries 2 71
  40. ! Modem not responding, send long break.
  41. LBreak
  42. jump 1
  43. !
  44. @LABEL 3
  45. ! Modem responding & configured.
  46. ! Determine if reliable link is requested.
  47. !
  48. ! If modem mnp10 link requested (var 4 == 2) then jump label 4
  49. ! If modem v42 link requested (var 4 == 1) then jump label 5
  50. ! If no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  51. !
  52. ifstr 4 4 "2"
  53. ifstr 4 5 "1"
  54. ifstr 4 9 "0"
  55. !
  56. ! Else invalid value in var 4, exit with error
  57. jump 76
  58. !
  59. @LABEL 4
  60. ! MNP10 reliable modem link is requested
  61. !
  62. @LABEL 5
  63. ! Reliable link is requested.  OK for LAP-M -> MNP 4.
  64. matchclr
  65. matchstr 1 7 "OK\13\10"
  66. ! W2    - gives Connect with DCE result codes
  67. ! \N3   - v42 autoreliable mode
  68. ! "H0 - Compression  (v42bis, MNP 5) disabled
  69. write "ATW2\\N3"H0\13"
  70. matchread 300
  71. jump 71
  72. !
  73. @LABEL 7
  74. ! If we DID support v42b in the modem, this is where it would go.
  75. !
  76. @LABEL 9
  77. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  78. ifstr 2 13 "1"
  79. pause 5
  80. matchclr
  81. matchstr 1 13 "OK\13\10"
  82. write "ATM0\13"
  83. matchread 30
  84. jump 71
  85. !
  86. ! Modem ready, so enable answer or dial mode - label range is 11-30
  87. ! Determine if answer or originate mode.
  88. !
  89. @LABEL 13
  90. pause 5
  91. ifANSWER 62
  92. !
  93. ! Dial type dispatch
  94. !
  95. ! Normal dialing (parm 6 == 0) jump to 19
  96. ! Blind  dialing (parm 6 == 1) jump to 17
  97. ! Manual dialing (parm 6 == 2) jump to 15 
  98. !
  99. ifstr 6 19 "0"
  100. ifstr 6 17 "1"
  101. ifstr 6 15 "2"
  102. !
  103. ! Else invalid value in var 6, exit with error
  104. jump 76
  105. !
  106. @label 15
  107. note "Manual dialing initiated..." 3
  108. ! X1 - ignore dialtone and busy for manual dialing, D to dial
  109. write "ATX1D \13"
  110. jump 32
  111. !
  112. @label 17
  113. note "Dialing without dialtone." 3
  114. matchclr
  115. matchstr 1 19 "OK\13\10"
  116. ! X3 - ignore dialtone but report busy for blind dialing
  117. write "ATX3\13"
  118. matchread 30
  119. jump 71
  120. !
  121. ! This is where we break up long dialstrings.
  122. ! This modem has a 255 chars command buffer and dial string
  123. ! fragmentation is not supported by Hayes.
  124. ! Labels 19 - 27 reserved. 
  125. !
  126. @label 19
  127. ! Parameter 1 contains the full dialstring from the connection document.
  128. ! Parameter 3 contains "P" for pulse & "T" for tone dialing.
  129. ! Parameter 7, 8 & 9 contain the dial string fragments.
  130. !
  131. note "Dialing ^1." 3
  132. write "ATD^3^7\13"
  133. jump 32
  134. !
  135. !    Connecting - label range is 31-60
  136. !
  137. @LABEL 32
  138. matchclr
  139. !
  140. matchstr 1 68 "RING\13\10"
  141. matchstr 2 72 "NO DIALTONE\13\10"
  142. matchstr 3 73 "NO CARRIER\13\10"
  143. matchstr 4 73 "ERROR\13\10"
  144. matchstr 5 74 "BUSY\13\10"
  145. matchstr 6 75 "NO ANSWER\13\10"
  146. !
  147. matchstr 7  34 "CONNECT 1200\13\10"
  148. matchstr 8  34 "CONNECT 1200/LAPM\13\10"
  149. matchstr 9  35 "CONNECT 2400\13\10"
  150. matchstr 10  35 "CONNECT 2400/LAPM\13\10"
  151. matchstr 11  36 "CONNECT 4800\13\10"
  152. matchstr 12  36 "CONNECT 4800/LAPM\13\10"
  153. matchstr 13  37 "CONNECT 7200\13\10"
  154. matchstr 14  37 "CONNECT 7200/LAPM\13\10"
  155. matchstr 15  38 "CONNECT 9600\13\10"
  156. matchstr 16  38 "CONNECT 9600/LAPM\13\10"
  157. matchstr 17  39 "CONNECT 12000\13\10"
  158. matchstr 18  39 "CONNECT 12000/LAPM\13\10"
  159. matchstr 19  40 "CONNECT 14400\13\10"
  160. matchstr 20  40 "CONNECT 14400/LAPM\13\10"
  161. matchstr 21  41 "CONNECT 16800\13\10"
  162. matchstr 22  41 "CONNECT 16800/LAPM\13\10"
  163. matchstr 23  42 "CONNECT 19200\13\10"
  164. matchstr 24  42 "CONNECT 19200/LAPM\13\10"
  165. matchstr 25  43 "CONNECT 21600\13\10"
  166. matchstr 26  43 "CONNECT 21600/LAPM\13\10"
  167. matchstr 27  44 "CONNECT 24000\13\10"
  168. matchstr 28  44 "CONNECT 24000/LAPM\13\10"
  169. matchstr 29  45 "CONNECT 26400\13\10"
  170. matchstr 30  45 "CONNECT 26400/LAPM\13\10"
  171. matchstr 31  46 "CONNECT 28800\13\10"
  172. matchstr 32  46 "CONNECT 28800/LAPM\13\10"
  173. !
  174. matchread 700
  175. ! If in ANSWER mode, loop back.
  176. ! Else in ORIGINATE mode, the modem has timed out.
  177. ifANSWER 32
  178. jump 71
  179. !
  180. !  This modem has been setup to do CTS handshaking,
  181. !  and we assume that a CTS handshaking cable is being used,
  182. !  so we leave the serial port set to 57600 bps.
  183. !  
  184. @LABEL 34
  185. note "Communicating at 1200 bps." 2
  186. CommunicatingAt 1200
  187. jump 58
  188. !
  189. @LABEL 35
  190. note "Communicating at 2400 bps." 2
  191. CommunicatingAt 2400
  192. jump 58
  193. !
  194. @LABEL 36
  195. note "Communicating at 4800 bps." 2
  196. CommunicatingAt 4800
  197. jump 58
  198. !
  199. @LABEL 37
  200. note "Communicating at 7200 bps." 2
  201. CommunicatingAt 7200
  202. jump 58
  203. !
  204. @LABEL 38
  205. note "Communicating at 9600 bps." 2
  206. CommunicatingAt 9600
  207. jump 58
  208. !
  209. @LABEL 39
  210. note "Communicating at 12000 bps." 2
  211. CommunicatingAt 12000
  212. jump 58
  213. !
  214. @LABEL 40
  215. note "Communicating at 14400 bps." 2
  216. CommunicatingAt 14400
  217. jump 58
  218. !
  219. @LABEL 41
  220. note "Communicating at 16800 bps." 2
  221. CommunicatingAt 16800
  222. jump 58
  223. !
  224. @LABEL 42
  225. note "Communicating at 19200 bps." 2
  226. CommunicatingAt 19200
  227. jump 58
  228. !
  229. @LABEL 43
  230. note "Communicating at 21600 bps." 2
  231. CommunicatingAt 21600
  232. jump 58
  233. !
  234. @LABEL 44
  235. note "Communicating at 24000 bps." 2
  236. CommunicatingAt 24000
  237. jump 58
  238. !
  239. @LABEL 45
  240. note "Communicating at 26400 bps." 2
  241. CommunicatingAt 26400
  242. jump 58
  243. !
  244. @LABEL 46
  245. note "Communicating at 28800 bps." 2
  246. CommunicatingAt 28800
  247. jump 58
  248. !
  249. @LABEL 58
  250. ! Add 5 second delay to insure compatibility with ARA 2.0.1.
  251. ! Each unit in the CCL is 1/10th of a second.
  252. pause 50
  253. !
  254. ifANSWER 59
  255. pause 30
  256. !
  257. @LABEL 59
  258. exit 0
  259. !
  260. ! @ANSWER
  261. ! Set the modem to answer on 1st ring - label range is 61-70
  262. !
  263. @LABEL 62
  264. matchclr
  265. ! On match jump to MODEM STATUS and wait for RING
  266. matchstr 1 32 "OK\13\10"
  267. write "ATS0=1\13"
  268. matchread 30
  269. jump 71
  270. !
  271. ! RING entry point
  272. ! If ORIGINATE mode return to waiting for input.
  273. ! Else claim the serial port and return.
  274. !
  275. @LABEL 68
  276. ifORIGINATE 32
  277. userhook 1
  278. note "Answering call..." 2
  279. jump 32
  280. !
  281. ! Error messages - label range is 71-100
  282. !
  283. ! Modem Not Responding
  284. @LABEL 71
  285. exit -6019
  286. !
  287. ! No Dialtone
  288. @LABEL 72
  289. exit -6020
  290. !
  291. ! No Carrier or Error
  292. @LABEL 73
  293. exit -6021
  294. !
  295. ! Busy
  296. @LABEL 74
  297. exit -6022
  298. !
  299. ! No Answer
  300. @LABEL 75
  301. exit -6023
  302. !
  303. ! Invalid Varstring Value
  304. @LABEL 76
  305. exit -6027
  306. !
  307. ! Hang up the modem - label range is 101-120
  308. !
  309. @HANGUP
  310. !
  311. @LABEL 102
  312. flush
  313. settries 0
  314. HSReset 0 1 0 0 0 0
  315. !
  316. @LABEL 105
  317. ! Drop the modem into command mode with escape sequence.
  318. ! Then tell modem to hangup.
  319. ! Repeat hangup command and escape sequence 3 times max.
  320. !
  321. flush
  322. matchclr
  323. matchstr 1 108 "OK\13\10"
  324. pause 10
  325. write "+++"
  326. matchread 15
  327. !
  328. @LABEL 108
  329. matchclr
  330. matchstr 1 111 "NO CARRIER\13\10"
  331. matchstr 2 111 "OK\13\10"
  332. matchstr 3 111 "ERROR\13\10"
  333. write "ATH0\13"
  334. matchread 30
  335. inctries
  336. iftries 3 71
  337. jump 105
  338. !
  339. ! recall the factory setting.
  340. !
  341. @LABEL 111
  342. pause 15
  343. matchclr
  344. matchstr 1 114 "OK\13\10"
  345. write "AT&F\13"
  346. matchread 30
  347. jump 71
  348. !
  349. @LABEL 114
  350. exit 0
  351. !
  352. ! Labels 121-128 are reserved for future emergency hacks.
  353. !
  354.